#include <iostream>
#include <cmath>

using namespace std;

int n;

int main()
{
	cin >> n;
	for(int i = n; i >= 0; i--)
	{
		int x; cin >> x;
		if(x == 0) continue;
		if(x < 0) cout << "-";
		if(x > 0 && i != n) cout << "+";
		if(abs(x) != 1 && i != 0)
		{
			cout << abs(x) << "x";
			if(i != 1) cout << "^" << i;
		}
		else
		{
			if(i == 0) cout << abs(x);
			else 
			{
				cout << "x";
				if(i != 1) cout << "^" << i;
			}
			
		}		
	}
	return 0;
}
